Skip to content

fix(terminal): compile Linux tpgid tests under pty - #687

Merged
Harry19081 merged 1 commit into
developfrom
fix/linux-terminal-tpgid-tests
Aug 6, 2026
Merged

fix(terminal): compile Linux tpgid tests under pty#687
Harry19081 merged 1 commit into
developfrom
fix/linux-terminal-tpgid-tests

Conversation

@Raymond8196

Copy link
Copy Markdown
Collaborator

Problem

On Linux, cargo test --workspace --no-run and Clippy with all targets fail before running tests with E0432: shells_tests.rs imports parse_tpgid_from_stat from the wrong module.

shells.rs mounts that file as pty_commands::shells::tests, so the nested Linux test module resolves super::super to pty_commands::shells. The private helper actually belongs to the sibling pty_commands::pty module, making the test target uncompilable on Linux.

Solution

Move the three Linux parse_tpgid_from_stat tests into the existing pty.rs test module.

The tests are now descendants of the module that owns the private helper, so they can exercise it without widening production visibility. Runtime code and behavior are unchanged.

Potential risks

The runtime risk is low because this changes only test placement and test names. Any external test filtering that referenced the old fully qualified test paths would need to use the new pty_commands::pty::tests::parse_tpgid_tests paths.

This PR does not clean the separate pre-existing Linux warnings or add Linux CI coverage. It was verified on Linux x86_64; macOS and Windows test execution was not repeated because the moved tests remain Linux-gated.

Verification

  • cargo test -p terminal parse_tpgid — passed: 3 passed, 0 failed.
  • cargo test --workspace --no-run — passed and generated every workspace test executable; the previous E0432 is gone.
  • cargo clippy -p terminal --all-targets — exited successfully; the separate pre-existing get_process_name_ps warning remains.
  • rustfmt --edition 2021 --check src-tauri/crates/terminal/src/pty_commands/pty.rs src-tauri/crates/terminal/src/pty_commands/tests/shells_tests.rs — passed.
  • git diff --check origin/develop...HEAD — passed.
  • Commit hook scoped Clippy to terminal — passed.

The full cargo test --workspace suite was not executed; the workspace test targets were compiled with --no-run, and the three affected tests were executed directly.

UI evidence

Not applicable: this PR changes only Rust test ownership and has no user-visible UI behavior.

Pre-commit hook ran. Total eslint: 0, total circular: 0
@Raymond8196
Raymond8196 requested a review from Harry19081 August 5, 2026 09:48
@Harry19081
Harry19081 merged commit 9b92e7b into develop Aug 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants